import { createApp } from "vue";
import App from "@/App.vue";
const app = createApp(App);

// 路由守卫
import "@/permission";

// 导入router
import router from "@/router";
app.use(router);

// 导入vuex
import store from "@/store";
app.use(store);

// 导入ElementPlus
import ElementPlus from "element-plus";
import "element-plus/theme-chalk/index.css";
app.use(ElementPlus);

// 导入ElementPlus的icon
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 导入第三方动画库
import "aos/dist/aos.css";

// 导入字体样式和自定义全局样式
import "@/assets/fonts/iconfont.css";
import "@/assets/css/common.scss";

// 导入rem自适应
import "@/utils/rem";

app.mount("#app");
